%{
#include <stdio.h>
#include "y.tab.h"
%}

%%

program			return PROGRAM;
integer			return INTEGER;
label			return LABEL;
boolean			return BOOLEAN;
char			return CHAR;
array			return ARRAY;
real			return REAL;
declare			return DECLARE;
begin			return TOKENBEGIN;
end			return END;
of			return OFF;
procedure 		return PROCEDURE;
if			return IF;
then			return THEN;
else			return ELSE;
do			return DO;
while			return WHILE;
read			return READ;
write			return WRITE;
goto			return GOTO;
return			return RETURN;
not			return NOT;
false			return TOKENFALSE;
true			return TOKENTRUE;
or			return OR;
and			return AND;
-			return MINUS;
=			return EQUALS;
[>]			return GREATER;
[>][=]			return GREATEREQ;
[!][=]			return DIFF;
[+]			return SUM;
[*]			return TIMES;
[/]			return DIV;
mod			return MOD;
[:][=]			return ATTRIB;


['] 			return SIMPLEASPAS;
,			return COLON;
:			return DOUBLEDOTS;
;			return SEMICOLON;
[(]			return OPENPAR;
[)]			return CLOSEPAR;
[[]			return OPENSQUARE;
[]]			return CLOSESQUARE;


[a-zA-Z][a-zA-Z0-9]*  	yylval.palavra=strdup(yytext); return IDENTIFIER;
[0-9]			yylval.num=atoi(yytext); return DIGIT;
[a-zA-Z0-9$%_@#!."':;?\|}{()~]  yylval.palavra=strdup(yytext); return CHARACTER;

\n                      /* ignora \n */;
[ \t]+                  /* ignora espaço */;
%%

int yywrap(){
	return 1;
}
